#include "net/Connector.h"
#include "net/InetAddress.h"
#include "net/EventLoop.h"
#include "Base/Logger.h"
#include <unistd.h>
void connectedCb(int sockfd) {
    int ret = ::write(sockfd, "hello", 5);
    LOG_INFO << "ret=" << ret;
    ::close(sockfd);
}

using namespace toym;
using namespace toym::net;

int main() {
    EventLoop loop;
    InetAddress serverAddr("127.0.0.1", 10077);
    Connector conn(&loop, serverAddr);
    conn.setConnectedCallback(connectedCb);
    conn.start();
    loop.loop();
}